<!--{include file="public/top" /}-->

<body>
<div class="x-body">
    <div class="layui-row clear pagesa" style="margin-bottom: 40px;">
        <p class="fl">>SEO设置</p>
    </div>
    <form class="layui-form" autocomplete="off">
        <div class="layui-form-item">
            <label  class="layui-form-label">
                <span class="x-red">*</span>标题
            </label>
            <div class="layui-input-block">
                <input type="hidden" name="data[0][id]" value="<!--{$list[0]['id']}-->">
                <input type="hidden" name="data[0][title]" value="<!--{$list[0]['title']}-->">
                <input type="hidden" name="data[0][type]" value="<!--{$list[0]['type']}-->">
                <input type="hidden" name="data[0][uptime]" value="<!--{:time()}-->">
                <input type="text" name="data[0][value]" value="<!--{$list[0]['value']}-->" lay-verify="required" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label  class="layui-form-label">
                <span class="x-red">*</span>关键词
            </label>
            <div class="layui-input-block">
                <input type="hidden" name="data[1][id]" value="<!--{$list[1]['id']}-->">
                <input type="hidden" name="data[1][title]" value="<!--{$list[1]['title']}-->">
                <input type="hidden" name="data[1][type]" value="<!--{$list[1]['type']}-->">
                <input type="hidden" name="data[1][uptime]" value="<!--{:time()}-->">
                <input type="text" name="data[1][value]" value="<!--{$list[1]['value']}-->" lay-verify="required" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label  class="layui-form-label">
                <span class="x-red">*</span>描述
            </label>
            <div class="layui-input-block">
                <input type="hidden" name="data[2][id]" value="<!--{$list[2]['id']}-->">
                <input type="hidden" name="data[2][title]" value="<!--{$list[2]['title']}-->">
                <input type="hidden" name="data[2][type']" value="<!--{$list[2]['type']}-->">
                <input type="hidden" name="data[2][uptime]" value="<!--{:time()}-->">
                <textarea style="width: 1500px;height: 100px" name="data[2][value]" class="layui-textarea"><!--{$list[2]['value']}--></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <label  class="layui-form-label">
                <span class="x-red">*</span>Head代码
            </label>
            <div class="layui-input-block">
                <input type="hidden" name="data[3][id]" value="<!--{$list[3]['id']}-->">
                <input type="hidden" name="data[3][title]" value="<!--{$list[3]['title']}-->">
                <input type="hidden" name="data[3][type]" value="<!--{$list[3]['type']}-->">
                <input type="hidden" name="data[3][uptime]" value="<!--{:time()}-->">
                <textarea style="width: 1500px;height: 100px" name="data[3][value]" class="layui-textarea"><!--{$list[3]['value']}--></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <label  class="layui-form-label">
                <span class="x-red">*</span>Body代码
            </label>
            <div class="layui-input-block">
                <input type="hidden" name="data[4][id]" value="<!--{$list[4]['id']}-->">
                <input type="hidden" name="data[4][title]" value="<!--{$list[4]['title']}-->">
                <input type="hidden" name="data[4][type]" value="<!--{$list[4]['type']}-->">
                <input type="hidden" name="data[4][uptime]" value="<!--{:time()}-->">
                <textarea style="width: 1500px;height: 100px" name="data[4][value]" class="layui-textarea"><!--{$list[4]['value']}--></textarea>
            </div>
        </div>
        <br>
        <div class="layui-form-item">
            <button type="button"  class="layui-btn layui-btn-normal" lay-filter="add" lay-submit="" style="margin-left: 100px">提交</button>
        </div>
    </form>
</div>
<script>

    var addurl = '/admin/config/setseo.html';
    //编辑器
    var ue = UE.getEditor('editor');
    layui.use(['form','layer'], function(){
        $ = layui.jquery;
        var form = layui.form
            ,layer = layui.layer;

        //自定义验证规则
        form.verify({
            pass: [/(.+){6,12}$/, '密码必须6到12位']
            ,repass: function(value){
                if($('#L_pass').val()!=$('#L_repass').val()){
                    return '两次密码不一致';
                }
            }
        });
        //监听提交
        form.on('submit(add)', function(data){
            $.post(addurl, data.field,function(res) {
                if(res.code===200){
                    layer.msg(res.msg, {
                        time: 1000, //不自动关闭
                        icon:6,
                        end:function () {
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);
                        }
                    });
                    return false;
                }else {
                    layer.msg(res.msg)
                }


            });

        });
    });

</script>
</body>

</html>